package com.cet.qz.unit01.chapter1_2;

import edu.princeton.cs.algs4.StdIn;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-03-02 21:21
 **/
public class Qz1_2_6 {

    public static void main(String[] args) {
        System.out.println("请输入一个字符串：");
        String str1 = StdIn.readString();
        System.out.println("请输入一个字符串：");
        String str2 = StdIn.readString();

        if (str1.length() == str2.length() && str1.concat(str1).indexOf(str2) != -1) {
            System.out.println(str1 + "和" + str2 + "是回环变位");
        } else {
            System.out.println(str1 + "和" + str2 + "不是是回环变位");
        }

    }
}
